cmake_minimum_required(VERSION 3.0.2)
project(serial_date)
add_definitions(-DNANO_RUN)
find_package(catkin REQUIRED COMPONENTS
  message_generation
  roscpp
  tf
  nav_msgs
  std_msgs
  geometry_msgs
  sensor_msgs
  message_generation
)

include(cmake/ziplib.cmake)
set(ALL_PATH ${PROJECT_SOURCE_DIR})
configure_file(
    "${PROJECT_SOURCE_DIR}/include/project_path.h.in"
    "${PROJECT_SOURCE_DIR}/include/project_path.h"
)

catkin_package(
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
  ./include
  lib/inc
  ${catkin_INCLUDE_DIRS}
)

find_library(PPS_DRIVE libpps_lib.a lib/bin)
find_library(SERIAL_DRIVE libserial_drive.a lib/bin)
find_library(SYSTIME libsys_time.a lib/bin)
find_library(MLOG libmlog_lib.a lib/bin)
find_library(TYEAR libTyear_lib.a lib/bin)
find_library(TX2TEM libTx2Tem_lib.a lib/bin)

aux_source_directory(./src SRC_LIST)
add_executable(serial_date ${SRC_LIST})
#add_dependencies(serial_date ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(serial_date
  -lssl 
  -lcrypto
  -lzip
  pthread
  log4cpp
  nanomsg
  ${SERIAL_DRIVE}
  ${PPS_DRIVE}
  ${SYSTIME}
  ${MLOG}
  ${TYEAR}
  ${TX2TEM}
  ${catkin_LIBRARIES}
)
